//import java.util.Scanner;
//
//public class Main {
//    public static void main(String[] args) {
//        Scanner scanner = new Scanner(System.in);
//        int n = scanner.nextInt();
//        int[] arr = new int[n];
//
//        for (int i = 0; i < n; i++) {
//            arr[i] = scanner.nextInt();
//        }
//
//        Solution solution = new Solution();
//        System.out.println(solution.isOneBitCharacter(arr));
//    }
//}
//
//class Solution {
//    public boolean isOneBitCharacter(int[] bits) {
//        int n = bits.length;
//        int sum = n;
//        for (int i = 0; i < n - 1; i++) {
//            if(bits[i] == 0){
//                sum--;
//            }else {
//                sum -= 2;
//                i++;
//            }
//        }
//        if(sum == 1){
//            return true;
//        }else {
//            return false;
//        }
//    }
//}
//class Solution {
//    public boolean isOneBitCharacter(int[] bits) {
//        int n = bits.length;
//        int sum0 = 0;
//        int sum1 = 0;
//        for (int i = 0; i < n - 1; i++) {
//            if(bits[i] == 1){
//                sum1++;
//            }else {
//                sum0++;
//            }
//        }
//        if((sum1 - sum0) % 2 == 0){
//            return true;
//        }else {
//            return false;
//        }
//    }
//}


import java.util.Arrays;
import java.util.Comparator;

public class Main{
    public static void main(String[] args) {
        Student student1 = new Student("张三",100);
        Student student2 = new Student("张三",50);
        Student student3 = new Student("张三",70);
        Student student4 = new Student("张三",90);
        Student student5 = new Student("张三",80);
        Student student6 = new Student("张三",60);
        Student[] students = new Student[]{student1,student2,student3,student4,student5,student6};

        Comparator<Student> nameComparator = Comparator.comparingInt(o -> o.score);

        Arrays.sort(students,nameComparator);
        for (Student s: students){
            System.out.println(s.toString());
        }

    }
}

class Student {
    String name;
    int score;

    public Student(String name, int score) {
        this.name = name;
        this.score = score;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", score=" + score +
                '}';
    }

}
